﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link href="../jquery-easyui-1.4.3/themes/icon.css" rel="stylesheet" />
    <link href="../jquery-easyui-1.4.3/themes/metro/easyui.css" rel="stylesheet" />
    <script src="../scripts/jquery.min.js"></script>
    <script src="../scripts/jquery.easyui.min.js"></script>
    <script type="text/javascript">
        $(function () {
          
            //添加
            $(".add").click(function () {
                $('#dd').dialog({
                    title: 'My Dialog',
                    width: 650,
                    height:400
                }).dialog("setTitle", "新增会员").dialog("open");
                $("#frim1").attr("src", "AddMember.html");
            });

            //删除
            $(".del").click(function () {
                //$.messager.alert('警告', '警告消息');
                var row = $("#dg").datagrid("getSelected");
                if (row != null) {
                    $.messager.confirm('确认', '您确认想要删除记录吗？', function (r) {
                        if (r) {
                            alert('确认删除');
                        }
                    });
                } else {
                    $.messager.alert("提示", "请选择要删除的行", "warning");
                }

               
            })
           //修改
            $(".update").click(function () {
                var row = $("#dg").datagrid("getSelected");
                if (row != null) {
                    $('#dd').dialog({
                        title: 'My Dialog',
                        width: 650,
                        height: 400
                    }).dialog("setTitle", "修改会员").dialog("open");
                    $("#frim1").attr("src", "UpdateMember.html");
                } else {
                    $.messager.alert("提示", "请选择要编辑的行","warning");

                }
                
            });
            //挂失与锁定
            $(".lock").click(function () {
                $('#dd').dialog({
                    title: 'My Dialog',
                    width: 400,
                    height: 200
                }).dialog("setTitle", "修改会员").dialog("open");
                $("#frim1").attr("src", "LockNum.html");
            });
            //转账
            $(".transfer").click(function () {
                $('#dd').dialog({
                    title: 'My Dialog',
                    width: 500,
                    height: 400
                }).dialog("setTitle", "会员转账").dialog("open");
                $("#frim1").attr("src", "MemberTransfer.html");
            });
            //换卡
            $(".Change").click(function () {
                $('#dd').dialog({
                    title: 'My Dialog',
                    width: 400,
                    height: 350
                }).dialog("setTitle", "修改会员").dialog("open");
                $("#frim1").attr("src", "MemberChangeCard.html");
            });

            //数据表格
            $('#dg').datagrid({
                method:"get",
                url: '/Member/datagrid_data1.json',
                columns: [[
                    { field: 'productid', title: '商品ID', width: 100 },
                    { field: 'productname', title: '商品名称', width: 100 },
                    { field: 'unitcost', title: '商品价格', width: 100, align: 'right' }
                  
                ]]
            });

            
            $('#dg').datagrid({
                width:"550px",
                height:"400px",
                fitColumns: true,//真正的自动展开/收缩列的大小，以适应网格的宽度，防止水平滚动
                toolbar: "#lxp",//通过选择器指定的工具栏
                pagination: true,//如果为true，则在DataGrid控件底部显示分页工具栏
                singleSelect: true,
                rownumbers: true,
                method: "get",
                url: '/Member/datagrid_data1.json',
                columns: [[
                   { field: 'productid', title: '商品ID', width: 100 },
                   { field: 'productname', title: '商品名称', width: 100 },
                   { field: 'unitcost', title: '商品价格', width: 100, align: 'right' }
                ]]
            });
        })
    </script>
	<meta charset="utf-8" />
   
</head>
<body>
    <div >
        <div style="padding:5px 0;" id="lxp" >
            <a href="#" class="easyui-linkbutton add" data-options="iconCls:'icon-add'">新增</a>
            <a href="#" class="easyui-linkbutton del" data-options="iconCls:'icon-remove'">删除</a>
            <a href="#" class="easyui-linkbutton update" data-options="iconCls:'icon-edit'">修改</a>
            <a href="#" class="easyui-linkbutton transfer" data-options="iconCls:'icon-icon1'">会员转账</a>
            <a href="#" class="easyui-linkbutton Change" data-options="iconCls:'icon-reload'">会员换卡</a>
            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-lock'">导出Excel</a>
            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-icon2'">导入Excel</a>
        </div>
        <div>
            会员卡号：<input type="text" id="MemberNubmer" style="width:100px;" />
            会员姓名：<input type="text" id="MemberName" style="width:100px;" />
            电话：<input id="MemberTel" type="text" style="width:100px;" />
            会员等级：<select style="width:100px;" id="dj" class="combo">
                <option></option>
                <option></option>
                <option></option>
                <option></option>
                <option></option>
            </select>
            状态：<select style="width:100px;" id="state" class="combo">
                <option></option>
                <option></option>
                <option></option>
                <option></option>
                <option></option>
            </select><br />
            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width:80px">查询</a>
        </div>
        <table id="dg"></table>  
        <!--<div id="pp" class="easyui-pagination" data-options="total:2000,pageSize:10" style="background:#efefef;border:1px solid #ccc; width:700px;"></div>-->
        
        
    </div>
    <div id="dd" style="margin-left:20px"  class="easyui-dialog" title="My Dialog" data-options="iconCls:'icon-save',resizable:true,modal:true,closed:true">  
      <iframe id="frim1" width="99%" height="99%" frameborder="0" scrolling="no" ></iframe>
    </div>  
    <!--<div id="win" class="easyui-window" title="My Window" style="width:600px;height:400px"
         data-options="iconCls:'icon-save',modal:true,closed:true">
       
        <iframe id="frim2" frameborder="0" scrolling="no"></iframe>
    </div>-->  
   
</body>
</html>
